package com.yzd.learnjava.enumerated;

import com.yzd.learnjava.util.Print;

public class EnumClass {
	public static void main(String[] args) {
		for(Shrubbery s : Shrubbery.values()) {
			Print.print(s + " ordinal: " + s.ordinal());
			Print.printnb(s.compareTo(Shrubbery.GRAWLING) + " ");
			Print.print(s.equals(Shrubbery.GRAWLING) + " ");
			Print.print(s == Shrubbery.GRAWLING);
			Print.print(s.getDeclaringClass());
			Print.print(s.name());
			Print.print("-------------------------");
		}
		
		for(String s : "HANGING GRAWLING GROUND".split(" ")) {
			Shrubbery shrubbery = Enum.valueOf(Shrubbery.class, s);
			Print.print(shrubbery);
		}
	}
}

enum Shrubbery{
	GROUND, GRAWLING, HANGING
}
